option1 = {
  grid: {
    top: '10%',
    right: 45,
    left: 45,
    bottom: 40
  },
  tooltip: {
    show:true
  },
  xAxis: [{
    type: 'category',
    color: '#59588D',
    data: ['蜀山区', '政务区', '合肥高新技术开发区', '合肥经济技术开发区','新站区','瑶海区','庐阳区','包河区','滨湖区','巢湖区','肥西县','肥东县','长丰县','庐江县'],
    axisLabel: {
      margin: 10,
      interval: 0,
      color: '#999',
      textStyle: {
        fontSize: 12
      },
      formatter: function (data) {
          if(data.length>5){
              return data.slice(0,5)+ '\n' + data.slice(5,data.length);
          }else {
              return data
          }
      }
    },
    axisLine: {
      lineStyle: {
        color: 'rgba(107,107,107,0.37)',
      }

    },
    axisTick: {
      show: false
    },
  }],
    dataZoom: [//滑动条
        {
            show: true,//是否显示滑动条
            type: 'slider',
            startValue: 0, // 从头开始。
            endValue: 8 ,
            bottom:"auto"
        }

    ],
  yAxis: [{
    min: 0,
    axisLabel: {
      formatter: '{value}',
      color: '#999',
      textStyle: {
        fontSize: 14
      },
    },
    axisLine: {
      lineStyle: {
        color: 'rgba(107,107,107,0.37)',
      }
    },
    axisTick: {
      show: false
    },
    splitLine: {
      lineStyle: {
        color: 'rgba(131,101,101,0.2)',
        type: 'dashed',
      }
    }
  }],
  series: [{
    name:"运输企业",
    type: 'bar',
    data: [140, 380, 120, 256,240, 280, 220, 156,140, 380,220, 156,220, 156],
    barWidth: '40%',
    barMaxWidth:16,
    barMinWidth:16,
    itemStyle: {
      normal: {
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
          offset: 0,
          color: '#176BFF' // 0% 处的颜色
        }, {
          offset: 1,
          color: '#87C3FF' // 100% 处的颜色
        }], false),
        barBorderRadius: [8, 8, 6, 6],
      }
    },
    label: {
      normal: {
        show: false,
      }
    }
  }]
};
var myChart1 = echarts.init(document.getElementById('warn'));
myChart1.setOption(option1);
$(window).resize(function(){
  myChart1.resize();
});
